import React, { useEffect, useState } from 'react'
import { Button, Input, Select, Space, Table } from 'antd';
import type { TableProps } from 'antd';
import { getBroker } from '@/api';

function Index() {

  const [broker, setBroker] = useState()

  useEffect(() => {

  }, [])


  const columns: TableProps<any>['columns'] = [
    {
      title: '序号',
      dataIndex: 'id',
      key: 'id',
    },
    {
      title: '姓名',
      dataIndex: 'uid',
      key: 'uid',
    },
    {
      title: '手机号',
      dataIndex: 'mobile',
      key: 'mobile',
    },
    {
      title: '类型',
      dataIndex: 'categray',
      key: 'categray',
      render: (_, record) => {
        if (record.categray == 0) {
          return <div>有房出租</div>
        } else if (record.categray == 1) {
          return <div>二手房出租</div>
        } else if (record.categray == 2) {
          return <div>我想租个房</div>
        }
      }
    },
    {
      title: '支付金额',
      dataIndex: 'payment',
      key: 'payment',
      render: (text) => <span>{text} ￥</span>
    },
    {
      title: '支付时间',
      dataIndex: 'update_time',
      key: 'update_time',
    },
    {
      title: '操作',
      key: 'action',
      render: (record) => (
        <Space size="middle">
          <a >查看</a>
        </Space>
      ),
    },
  ];
  return (
    <div>
      <p>经纪人管理</p>

      {/* 表格 */}
      <Table columns={columns} dataSource={broker} bordered />
    </div>
  )
}

export default Index
